﻿using System;
using System.Reflection;
using log4net;
using log4net.Config;
using log4net.Core;
using log4net.Repository;

namespace WikiBotDll
{
    public class ColorLogger : log4net.ILog
    {
        private readonly ILog log;

        public ColorLogger(ILog log)
        {
            this.log = log;
        }

        public void Error(object message)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.Error(message);
            Console.ResetColor();
        }

        public void Info(object message)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            log.Info(message);
            Console.ResetColor();

        }

        public void Debug(object message)
        {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            log.Debug(message);
            Console.ResetColor();

        }

        public void Warn(object message)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            log.Warn(message);
            Console.ResetColor();

        }

        public void GreenInfo(object message)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            log.Info(message);
            Console.ResetColor();
        }

        public void DarkInfo(object message)
        {
            Console.ForegroundColor = ConsoleColor.DarkGray;
            //Console.BackgroundColor = ConsoleColor.DarkGray;
            log.Info(message);
            Console.ResetColor();
        }

        #region Implementation of ILoggerWrapper

        public ILogger Logger
        {
            get { throw new NotImplementedException(); }
        }

        #endregion

        #region Implementation of ILog

        public void Debug(object message, Exception exception)
        {
            throw new NotImplementedException();
        }

        public void DebugFormat(string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void DebugFormat(string format, object arg0)
        {
            throw new NotImplementedException();
        }

        public void DebugFormat(string format, object arg0, object arg1)
        {
            throw new NotImplementedException();
        }

        public void DebugFormat(string format, object arg0, object arg1, object arg2)
        {
            throw new NotImplementedException();
        }

        public void DebugFormat(IFormatProvider provider, string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void Info(object message, Exception exception)
        {
            throw new NotImplementedException();
        }

        public void InfoFormat(string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void InfoFormat(string format, object arg0)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            log.InfoFormat(format,arg0);
            Console.ResetColor();
        }

        public void InfoFormat(string format, object arg0, object arg1)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            log.InfoFormat(format, arg0,arg1);
            Console.ResetColor();
        }

        public void InfoFormat(string format, object arg0, object arg1, object arg2)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            log.InfoFormat(format, arg0,arg1,arg2);
            Console.ResetColor();
        }

        public void InfoFormat(IFormatProvider provider, string format, params object[] args)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            log.InfoFormat(provider,format,args);
            Console.ResetColor();
        }


        public void Warn(object message, Exception exception)
        {
            throw new NotImplementedException();
        }

        public void WarnFormat(string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void WarnFormat(string format, object arg0)
        {
            throw new NotImplementedException();
        }

        public void WarnFormat(string format, object arg0, object arg1)
        {
            throw new NotImplementedException();
        }

        public void WarnFormat(string format, object arg0, object arg1, object arg2)
        {
            throw new NotImplementedException();
        }

        public void WarnFormat(IFormatProvider provider, string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void Error(object message, Exception exception)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.Error(message, exception);
            Console.ResetColor();
        }

        public void ErrorFormat(string format, params object[] args)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.ErrorFormat(format, args);
            Console.ResetColor();
        }

        public void ErrorFormat(string format, object arg0)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.ErrorFormat(format, arg0);
            Console.ResetColor();
        }

        public void ErrorFormat(string format, object arg0, object arg1)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.ErrorFormat(format, arg0,arg1);
            Console.ResetColor();
        }

        public void ErrorFormat(string format, object arg0, object arg1, object arg2)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.ErrorFormat(format, arg0, arg1, arg2);
            Console.ResetColor();
        }

        public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            log.ErrorFormat(provider, format, args);
            Console.ResetColor();
        }

        public void Fatal(object message)
        {
            throw new NotImplementedException();
        }

        public void Fatal(object message, Exception exception)
        {
            throw new NotImplementedException();
        }

        public void FatalFormat(string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public void FatalFormat(string format, object arg0)
        {
            throw new NotImplementedException();
        }

        public void FatalFormat(string format, object arg0, object arg1)
        {
            throw new NotImplementedException();
        }

        public void FatalFormat(string format, object arg0, object arg1, object arg2)
        {
            throw new NotImplementedException();
        }

        public void FatalFormat(IFormatProvider provider, string format, params object[] args)
        {
            throw new NotImplementedException();
        }

        public bool IsDebugEnabled
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsInfoEnabled
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsWarnEnabled
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsErrorEnabled
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsFatalEnabled
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
